package zhtt.biz.web.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 这里设置/index.html为默认访问路径的视图控制器
        registry.addViewController("/").setViewName("forward:/index.html");

        //registry.addViewController("/").setViewName("forward:/app1/index.html");

        // 如果你想让/index也直接转发到index.html，可以添加如下行
        // registry.addViewController("/index").setViewName("forward:/index.html");
    }
}
